<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>系统设置 - 拖拽式建站平台</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
        }

        :root {
            --sidebar-width: 240px;
            --header-height: 64px;
            --primary-color: #3498db;
            --secondary-color: #2c3e50;
            --bg-color: #f5f6f7;
            --card-bg: #ffffff;
            --text-primary: #18191c;
            --text-secondary: #61666d;
            --text-muted: #9499a0;
            --border-color: #e3e5e7;
            --success-color: #27ae60;
            --warning-color: #f39c12;
            --danger-color: #e74c3c;
        }

        body {
            background-color: var(--bg-color);
            color: var(--text-primary);
            display: flex;
            flex-direction: column;
            height: 100vh;
            overflow: hidden;
        }

        /* 顶部导航栏 */
        .header {
            height: var(--header-height);
            background: var(--card-bg);
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
            border-bottom: 1px solid var(--border-color);
            z-index: 100;
        }

        .header-left {
            display: flex;
            align-items: center;
        }

        .sidebar-toggle {
            margin-right: 16px;
            cursor: pointer;
            color: var(--text-secondary);
            font-size: 18px;
        }

        .logo {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            display: flex;
            align-items: center;
        }

        .logo i {
            margin-right: 10px;
            color: var(--primary-color);
        }

        .header-right {
            display: flex;
            align-items: center;
        }

        .header-action {
            margin-left: 16px;
            color: var(--text-secondary);
            cursor: pointer;
            position: relative;
        }

        .header-action:hover {
            color: var(--primary-color);
        }

        .badge {
            position: absolute;
            top: -5px;
            right: -5px;
            background: var(--danger-color);
            color: white;
            font-size: 11px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .user-menu {
            display: flex;
            align-items: center;
            margin-left: 20px;
            cursor: pointer;
        }

        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--primary-color);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-left: 12px;
        }

        /* 主内容区域 */
        .main-container {
            display: flex;
            flex: 1;
            overflow: hidden;
        }

        /* 侧边栏 */
        .sidebar {
            width: var(--sidebar-width);
            background: var(--card-bg);
            border-right: 1px solid var(--border-color);
            overflow-y: auto;
            transition: all 0.3s ease;
        }

        .sidebar-menu {
            padding: 16px 0;
        }

        .menu-title {
            padding: 10px 20px;
            font-size: 13px;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .menu-item {
            display: flex;
            align-items: center;
            padding: 12px 20px;
            color: var(--text-secondary);
            text-decoration: none;
            transition: all 0.3s ease;
            border-left: 3px solid transparent;
        }

        .menu-item:hover {
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
        }

        .menu-item.active {
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
            border-left-color: var(--primary-color);
        }

        .menu-item i {
            margin-right: 12px;
            width: 18px;
            text-align: center;
        }

        /* 内容区域 */
        .content {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
        }

        .page-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }

        .page-title {
            font-size: 24px;
            font-weight: 600;
        }

        .page-actions .btn {
            margin-left: 10px;
        }

        /* 设置区域 */
        .settings-container {
            display: flex;
            flex: 1;
            gap: 20px;
        }

        /* 设置侧边导航 */
        .settings-nav {
            width: 240px;
            background: var(--card-bg);
            border-radius: 4px;
            overflow: hidden;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            flex-shrink: 0;
        }

        .nav-header {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-color);
            font-weight: 500;
            color: var(--text-primary);
        }

        .nav-items {
            padding: 8px 0;
        }

        .nav-item {
            padding: 12px 20px;
            display: flex;
            align-items: center;
            color: var(--text-secondary);
            text-decoration: none;
            transition: all 0.3s ease;
            border-left: 3px solid transparent;
        }

        .nav-item:hover {
            background: rgba(52, 152, 219, 0.05);
            color: var(--primary-color);
        }

        .nav-item.active {
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
            border-left-color: var(--primary-color);
        }

        .nav-item i {
            margin-right: 12px;
            width: 18px;
            text-align: center;
        }

        /* 设置内容区域 */
        .settings-content {
            flex: 1;
            background: var(--card-bg);
            border-radius: 4px;
            overflow: hidden;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            display: flex;
            flex-direction: column;
        }

        .content-header {
            padding: 20px;
            border-bottom: 1px solid var(--border-color);
        }

        .content-title {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 8px;
        }

        .content-description {
            color: var(--text-secondary);
            font-size: 14px;
        }

        .content-body {
            padding: 20px;
            flex: 1;
            overflow-y: auto;
        }

        .settings-section {
            margin-bottom: 32px;
        }

        .section-title {
            font-size: 16px;
            font-weight: 500;
            margin-bottom: 16px;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
        }

        .section-title i {
            margin-right: 8px;
            color: var(--primary-color);
        }

        .form-group {
            margin-bottom: 16px;
        }

        .form-label {
            display: block;
            font-size: 14px;
            color: var(--text-secondary);
            margin-bottom: 6px;
            font-weight: 500;
        }

        .form-input {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--border-color);
            border-radius: 4px;
            font-size: 14px;
            transition: all 0.3s ease;
        }

        .form-input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
        }

        .form-textarea {
            min-height: 100px;
            resize: vertical;
        }

        .form-select {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--border-color);
            border-radius: 4px;
            background: white;
            font-size: 14px;
        }

        .form-check {
            display: flex;
            align-items: center;
        }

        .form-check-input {
            margin-right: 8px;
        }

        .form-check-label {
            font-size: 14px;
            color: var(--text-secondary);
        }

        .form-row {
            display: flex;
            gap: 16px;
        }

        .form-col {
            flex: 1;
        }

        .color-picker {
            display: flex;
            align-items: center;
        }

        .color-preview {
            width: 30px;
            height: 30px;
            border-radius: 4px;
            margin-right: 10px;
            border: 1px solid var(--border-color);
        }

        .color-input {
            flex: 1;
        }

        .file-upload {
            position: relative;
            display: inline-block;
            width: 100%;
        }

        .file-input {
            position: absolute;
            left: 0;
            top: 0;
            opacity: 0;
            width: 100%;
            height: 100%;
            cursor: pointer;
        }

        .file-label {
            display: block;
            padding: 10px 12px;
            border: 1px dashed var(--border-color);
            border-radius: 4px;
            text-align: center;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .file-label:hover {
            border-color: var(--primary-color);
            color: var(--primary-color);
        }

        .image-preview {
            height: 120px;
            border-radius: 4px;
            border: 1px solid var(--border-color);
            margin-top: 10px;
            background-size: contain;
            background-position: center;
            background-repeat: no-repeat;
            background-color: #f9fafc;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
        }

        .content-footer {
            padding: 20px;
            border-top: 1px solid var(--border-color);
            display: flex;
            justify-content: flex-end;
            gap: 12px;
        }

        .code-editor {
            font-family: 'Courier New', monospace;
            background: #2d2d2d;
            color: #f8f8f2;
            border-radius: 4px;
            padding: 12px;
            min-height: 200px;
            overflow: auto;
        }

        .service-card {
            border: 1px solid var(--border-color);
            border-radius: 4px;
            padding: 16px;
            margin-bottom: 16px;
            background: #f9fafc;
        }

        .service-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }

        .service-title {
            font-weight: 500;
            display: flex;
            align-items: center;
        }

        .service-title i {
            margin-right: 8px;
            color: var(--primary-color);
        }

        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 50px;
            height: 24px;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #ccc;
            transition: .4s;
            border-radius: 24px;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 18px;
            width: 18px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }

        input:checked+.slider {
            background-color: var(--primary-color);
        }

        input:checked+.slider:before {
            transform: translateX(26px);
        }

        .backup-list {
            list-style: none;
        }

        .backup-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 16px;
            border-bottom: 1px solid var(--border-color);
        }

        .backup-item:last-child {
            border-bottom: none;
        }

        .backup-info {
            display: flex;
            flex-direction: column;
        }

        .backup-name {
            font-weight: 500;
        }

        .backup-meta {
            font-size: 13px;
            color: var(--text-muted);
        }

        /* 按钮样式 */
        .btn {
            padding: 8px 16px;
            border: none;
            border-radius: 4px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .btn i {
            margin-right: 6px;
        }

        .btn-primary {
            background: var(--primary-color);
            color: white;
        }

        .btn-primary:hover {
            background: #2980b9;
        }

        .btn-outline {
            background: transparent;
            border: 1px solid var(--border-color);
            color: var(--text-secondary);
        }

        .btn-outline:hover {
            background: #f5f7fa;
        }

        .btn-success {
            background: var(--success-color);
            color: white;
        }

        .btn-success:hover {
            background: #219653;
        }

        .btn-danger {
            background: var(--danger-color);
            color: white;
        }

        .btn-danger:hover {
            background: #c0392b;
        }

        .btn-sm {
            padding: 4px 8px;
            font-size: 13px;
        }

        /* 响应式设计 */
        @media (max-width: 992px) {
            .settings-container {
                flex-direction: column;
            }

            .settings-nav {
                width: 100%;
            }

            .sidebar {
                position: fixed;
                left: -var(--sidebar-width);
                top: var(--header-height);
                bottom: 0;
                z-index: 90;
            }

            .sidebar.open {
                left: 0;
            }

            .overlay {
                position: fixed;
                top: var(--header-height);
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(0, 0, 0, 0.5);
                z-index: 80;
                display: none;
            }

            .overlay.open {
                display: block;
            }
        }

        @media (max-width: 768px) {
            .form-row {
                flex-direction: column;
                gap: 0;
            }

            .page-header {
                flex-direction: column;
                align-items: flex-start;
            }

            .page-actions {
                margin-top: 16px;
                width: 100%;
                display: flex;
                justify-content: space-between;
            }

            .page-actions .btn {
                margin-left: 0;
                flex: 1;
                margin: 0 5px;
            }
        }
    </style>
</head>

<body>
    <!-- 顶部导航栏 -->
    <div class="header">
        <div class="header-left">
            <div class="sidebar-toggle">
                <i class="fas fa-bars"></i>
            </div>
            <div class="logo">
                <i class="fas fa-puzzle-piece"></i>
                拖拽建站后台
            </div>
        </div>

        <div class="header-right">
            <div class="header-action">
                <i class="fas fa-bell"></i>
                <span class="badge">3</span>
            </div>

            <div class="header-action">
                <i class="fas fa-envelope"></i>
                <span class="badge">5</span>
            </div>

            <div class="user-menu">
                <span>管理员</span>
                <div class="user-avatar">
                    <i class="fas fa-user"></i>
                </div>
            </div>
        </div>
    </div>

    <!-- 主内容区域 -->
    <div class="main-container">
        <!-- 侧边栏 -->
        <div class="sidebar">
            <div class="sidebar-menu">
                <div class="menu-title">主导航</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-home"></i>
                    <span>控制台</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-paint-brush"></i>
                    <span>网站管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-file-alt"></i>
                    <span>页面管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-th-large"></i>
                    <span>组件库</span>
                </a>

                <div class="menu-title">内容管理</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-newspaper"></i>
                    <span>文章管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-box"></i>
                    <span>产品管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-images"></i>
                    <span>媒体库</span>
                </a>

                <div class="menu-title">用户与权限</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-users"></i>
                    <span>用户管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-shield-alt"></i>
                    <span>角色权限</span>
                </a>
                <a href="#" class="menu-item active">
                    <i class="fas fa-cog"></i>
                    <span>系统设置</span>
                </a>
            </div>
        </div>

        <!-- 内容区域 -->
        <div class="content">
            <div class="page-header">
                <h1 class="page-title">系统设置</h1>
                <div class="page-actions">
                    <button class="btn btn-outline">
                        <i class="fas fa-history"></i> 恢复默认
                    </button>
                    <button class="btn btn-primary">
                        <i class="fas fa-save"></i> 保存设置
                    </button>
                </div>
            </div>

            <!-- 设置区域 -->
            <div class="settings-container">
                <!-- 设置导航 -->
                <div class="settings-nav">
                    <div class="nav-header">设置分类</div>
                    <div class="nav-items">
                        <a href="#" class="nav-item">
                            <i class="fas fa-globe"></i>
                            <span>基本设置</span>
                        </a>
                        <a href="#" class="nav-item active">
                            <i class="fas fa-lock"></i>
                            <span>安全设置</span>
                        </a>
                        <a href="#" class="nav-item">
                            <i class="fas fa-paint-brush"></i>
                            <span>外观设置</span>
                        </a>
                        <a href="#" class="nav-item">
                            <i class="fas fa-envelope"></i>
                            <span>邮件设置</span>
                        </a>
                        <a href="#" class="nav-item">
                            <i class="fas fa-database"></i>
                            <span>数据管理</span>
                        </a>
                        <a href="#" class="nav-item">
                            <i class="fas fa-plug"></i>
                            <span>第三方服务</span>
                        </a>
                        <a href="#" class="nav-item">
                            <i class="fas fa-code"></i>
                            <span>自定义代码</span>
                        </a>
                    </div>
                </div>

                <!-- 设置内容 -->
                <div class="settings-content">
                    <div class="content-header">
                        <div class="content-title">安全设置</div>
                        <div class="content-description">配置系统安全选项和访问控制</div>
                    </div>

                    <div class="content-body">
                        <div class="settings-section">
                            <div class="section-title">
                                <i class="fas fa-shield-alt"></i>
                                账户安全
                            </div>

                            <div class="form-group">
                                <div class="form-check">
                                    <input type="checkbox" class="form-check-input" id="twoFactorAuth" checked>
                                    <label class="form-check-label" for="twoFactorAuth">启用双因素认证 (2FA)</label>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="form-check">
                                    <input type="checkbox" class="form-check-input" id="strongPasswords" checked>
                                    <label class="form-check-label" for="strongPasswords">强制使用强密码</label>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="form-check">
                                    <input type="checkbox" class="form-check-input" id="loginAttempts" checked>
                                    <label class="form-check-label" for="loginAttempts">启用登录尝试限制</label>
                                </div>
                            </div>

                            <div class="form-row">
                                <div class="form-col">
                                    <label class="form-label">最大登录尝试次数</label>
                                    <input type="number" class="form-input" value="5" min="3" max="10">
                                </div>
                                <div class="form-col">
                                    <label class="form-label">锁定时间(分钟)</label>
                                    <input type="number" class="form-input" value="30" min="5" max="1440">
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="form-check">
                                    <input type="checkbox" class="form-check-input" id="sessionTimeout" checked>
                                    <label class="form-check-label" for="sessionTimeout">启用会话超时</label>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="form-label">会话超时时间(分钟)</label>
                                <input type="number" class="form-input" value="120" min="15" max="1440">
                            </div>
                        </div>

                        <div class="settings-section">
                            <div class="section-title">
                                <i class="fas fa-ban"></i>
                                访问控制
                            </div>

                            <div class="form-group">
                                <label class="form-label">IP白名单</label>
                                <textarea class="form-input form-textarea" placeholder="输入允许访问的IP地址，每行一个">192.168.1.1
192.168.1.100</textarea>
                                <div class="form-label"
                                    style="font-size: 12px; color: var(--text-muted); margin-top: 4px;">留空表示允许所有IP访问
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="form-label">IP黑名单</label>
                                <textarea class="form-input form-textarea" placeholder="输入禁止访问的IP地址，每行一个">10.0.0.25
172.16.0.100</textarea>
                            </div>

                            <div class="form-group">
                                <div class="form-check">
                                    <input type="checkbox" class="form-check-input" id="adminRestrict" checked>
                                    <label class="form-check-label" for="adminRestrict">限制管理员后台访问IP</label>
                                </div>
                            </div>
                        </div>

                        <div class="settings-section">
                            <div class="section-title">
                                <i class="fas fa-certificate"></i>
                                SSL/HTTPS设置
                            </div>

                            <div class="form-group">
                                <div class="form-check">
                                    <input type="checkbox" class="form-check-input" id="forceHTTPS" checked>
                                    <label class="form-check-label" for="forceHTTPS">强制使用HTTPS</label>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="form-check">
                                    <input type="checkbox" class="form-check-input" id="hstsEnabled">
                                    <label class="form-check-label" for="hstsEnabled">启用HSTS(HTTP严格传输安全)</label>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="form-label">HSTS最大有效期(天)</label>
                                <input type="number" class="form-input" value="365" min="30" max="730">
                            </div>
                        </div>
                    </div>

                    <div class="content-footer">
                        <button class="btn btn-outline">
                            <i class="fas fa-times"></i> 取消
                        </button>
                        <button class="btn btn-primary">
                            <i class="fas fa-save"></i> 保存更改
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 移动端遮罩层 -->
    <div class="overlay"></div>

    <script>
        document.addEventListener('DOMContentLoaded', function () {
            // 侧边栏切换
            const sidebarToggle = document.querySelector('.sidebar-toggle');
            const sidebar = document.querySelector('.sidebar');
            const overlay = document.querySelector('.overlay');

            sidebarToggle.addEventListener('click', function () {
                sidebar.classList.toggle('open');
                overlay.classList.toggle('open');
            });

            overlay.addEventListener('click', function () {
                sidebar.classList.remove('open');
                overlay.classList.remove('open');
            });

            // 设置导航项点击
            const navItems = document.querySelectorAll('.nav-item');

            navItems.forEach(item => {
                item.addEventListener('click', function (e) {
                    e.preventDefault();
                    navItems.forEach(i => i.classList.remove('active'));
                    this.classList.add('active');

                    // 更新内容标题和描述
                    const tabName = this.querySelector('span').textContent;
                    document.querySelector('.content-title').textContent = tabName;

                    // 更新描述文本
                    const descriptions = {
                        '基本设置': '配置系统的基本信息和运行参数',
                        '安全设置': '配置系统安全选项和访问控制',
                        '外观设置': '自定义系统界面外观和主题',
                        '邮件设置': '配置邮件服务器和通知设置',
                        '数据管理': '管理系统数据和备份设置',
                        '第三方服务': '集成和管理第三方服务',
                        '自定义代码': '添加自定义CSS和JavaScript代码'
                    };

                    document.querySelector('.content-description').textContent = descriptions[tabName] || '配置系统设置';

                    // 这里可以添加加载对应设置内容的代码
                    console.log('切换到设置: ' + tabName);
                });
            });

            // 图片上传预览
            const fileInputs = document.querySelectorAll('.file-input');

            fileInputs.forEach(input => {
                input.addEventListener('change', function () {
                    const preview = this.closest('.form-group').querySelector('.image-preview');
                    if (this.files && this.files[0]) {
                        const reader = new FileReader();
                        reader.onload = function (e) {
                            preview.style.backgroundImage = `url(${e.target.result})`;
                            preview.innerHTML = '';
                        };
                        reader.readAsDataURL(this.files[0]);
                    }
                });
            });
        });
    </script>
</body>

</html>